package GUI;

import java.awt.Color;
import java.awt.Component;

import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;



class MyTableCellRenderer extends DefaultTableCellRenderer {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	

	public MyTableCellRenderer() {
		super();
		setOpaque(true);
	}

	public Component getTableCellRendererComponent(JTable table, Object value,
			boolean isSelected, boolean hasFocus, int row, int column) {

		Component comp = super.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
		String number = (String) value;
		int val = Integer.parseInt(number);

		if (val == 0) {
				comp.setForeground(Color.black);
				comp.setBackground(Color.red);
			
		} 
		return comp;
	}
}
